import http from '@/api/request';

// 获取短视频分类列表
export const getVideoCategory = () => {
  return http.request({
    method: 'GET',
    url: '/app/video/category_list',
    params: { status: 1 },
  });
};

// 获取短视频列表
export const getVideos = (page: number, limit: number, category_id: number) => {
  return http.request({
    method: 'GET',
    url: '/app/video/list',
    params: { page_size: limit, page: page, category_id: category_id, status: 1 },
  });
};

// 获取短视频详情列表
export const getVideoDetails = (videoId: number, limit: number) => {
  return http.request({
    method: 'GET',
    url: '/app/video/detail_list',
    params: { video_id: videoId, page_size: limit },
  });
};

// 短视频点赞
export const setVideoLike = (video_id: number, is_like: number) => {
  return http.request({
    method: 'POST',
    url: '/app/video/set_like',
    data: { video_id: video_id, status: is_like },
  });
};

// 短视频评论
export const setVideoComment = (video_id: number, content: string) => {
  return http.request({
    method: 'POST',
    url: '/app/video/set_comment',
    data: { video_id: video_id, content: content },
  });
};

// 短视频评论
export const getVideoComments = (page: number, limit: number, video_id: number) => {
  return http.request({
    method: 'GET',
    url: '/app/video/comment_list',
    params: { page_size: limit, page: page, video_id: video_id, status: 1 },
  });
};
